<?php

class Eleven_Form_Student_Reply extends Zend_Form
{
    public function init()
    {
    	$this->setDisableLoadDefaultDecorators(true);
        $this->setDecorators(array(
            array(
                'ViewScript',
                array('viewScript'=>'student/_reply.phtml')
            ),
            'Form'
        ));
        
        $this->setAttrib('id', 'studentReply');
        
         // create new element
        $message = $this->createElement('textarea', 'content');
        // element options
        $message->setLabel('回复内容<br/>Content:');
        $message->setRequired(TRUE);
        $message->setAttrib('cols',60);
        $message->setAttrib('rows',3);
        // add the element to the form
        $this->addElement($message);
        $this->getElement('content')->setDecorators(array(
            'ViewHelper',
 		    'Errors',
        ));
        $message->addValidator('StringLength', false, array(6, 500));
         
        // create the captcha control
        $captcha = new Zend_Form_Element_Captcha('verification', array(
				    'label' => "请输入正确的验证码：",
				    'captcha' => array(
				        'captcha' => 'Image',
				        'wordLen' => 4,
				        'timeout' => 300,
        				'font'=>'F:\AppServ\www\xuexiquan\public\images\font.ttf', 
				    ),
				));
        
		$captcha->getCaptcha()->setDotNoiseLevel(0);
		$captcha->getCaptcha()->setLineNoiseLevel(0);
		$captcha->getCaptcha()->setWidth(100);
		$captcha->getCaptcha()->setHeight(40);
		$captcha->getCaptcha()->setFontSize(16);
		
        $this->addElement($captcha);
		$this->getElement('verification')->removeDecorator('Label');
        
        $contentId = $this->createElement('hidden', 'contentId');
        $this->addElement($contentId);
        
        $submit = $this->addElement('submit', 'submit');
        $this->getElement('submit')->setLabel('')
        	->setAttrib('class','reply_submit');           
    }

}

?>